var postTitle=new Array();
var postUrl=new Array();
var postMp3=new Array();
var postDate=new Array();
var postYear=new Array();
var postMonth=new Array();
var postYearMonth=new Array();
var postYearMonth2=new Array();
var postTanggal=new Array();
var postLabels=new Array();
var postBaru=new Array();
var sortBy="titleasc";
var tocLoaded=true;
var numChars=500;
var postFilter="";
var numberfeed=0;
var month2=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"];

function request() 
{ 
  var scriptArgs = document.getElementById("searchScript").getAttribute("data");
  //var scripts = document.getElementsByTagName("script");
  //var scriptArgs = scripts[ scripts.length - 1 ].innerHTML.replace(/[s]/g,'');
  return scriptArgs.split("=").pop();
}

var postSearchLabel = request();
function loadtoc(a)
{
  function b()
  {
    if("entry" in a.feed)
    {
      var d=a.feed.entry.length;//alert(d);
      numberfeed=d;
      ii=0;
      for(var h=0;h<d;h++)
      {
        var m=a.feed.entry[h];
        var e=m.title.$t;
        var l=m.published.$t.substring(0,10);
        var p=m.published.$t.substring(5,7);
        var g=m.published.$t.substring(8,10);
        var n=m.published.$t.substring(0,4)+" "+month2[parseInt(p,10)-1];
        var c="/"+m.published.$t.substring(0,4)+"_"+p+"_01_archive.html";
        var j;
        for(var f=0;f<m.link.length;f++)
        {
          if(m.link[f].rel=="alternate")
          {
            j=m.link[f].href;
            break
          }
        }
        var o="";
        for(var f=0;f<m.link.length;f++)
        {
          if(m.link[f].rel=="enclosure")
          {
            o=m.link[f].href;
            break
          }
        }
        var c="";
        if("category" in m)
        {
          for(var f=0;f<m.category.length;f++)
          {
             c=m.category[f].term;
             var ff=c.lastIndexOf(";");
             if(ff!=-1)
             {
               c=c.substring(0,f)
             }
             postLabels[ii]=c;ii++;
          }
        }
        postTitle.push(e);
        postDate.push(l);
        postUrl.push(j);
        postYearMonth.push(n);
        postYearMonth2.push(c);
        postTanggal.push(g)
      }
    }
  }
  b();
  displayToc2()
}
function displayToc2()
{
  var a=0;
  var b=0;
  while(b<postTitle.length)
  {
        temp1=postYearMonth[b];
       // document.write("<p/>");
        document.write('<p><a href="'+postYearMonth2[b]+'">'+temp1+"</a></p><ul>");
        firsti=a;
        do
       {
            if(postLabels[a]==postSearchLabel) 
            {
                document.write("<li>");
                document.write("["+postTanggal[a]+'] <a href="'+postUrl[a]+'">'+postTitle[a]+"</a>");
                document.write("</li>");     
            }
            a=a+1
       }
       while(postYearMonth[a]==temp1);
           b=a;
       document.write("</ul>");
       if(b>postTitle.length){break}
   }
};
